﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Web.Services.Protocols;
using EconomicInformationServiceWcf.ServiceBehaviours;
using Interfaces.Enums;
using ServiceInfrastructure.Models.Exceptions;
using ServiceInfrastructure.Models.SecurityModels;
using ServiceInfrastructure.Models.UserSettingsModel;
using ServiceInfrastructure.Models.UserSettingsModel.Favorite;
using ServiceInfrastructure.ServiceConstants;

namespace EconomicInformationServiceWcf
{
    [ServiceContract(Name = ServiceConstants.UserSettingsServicecontract, Namespace = ServiceConstants.UserSettingsServicenamespace)]
    [EISHeaders]
    [EISApplication]
    public interface IUserSettingsService
    {

        #region save methods

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void AddFavoriteNews(AddFavoriteItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void AddFavoriteFeed(AddFavoriteItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void AddFavoriteLink(AddFavoriteItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void SaveNewsFilter(SaveNewsFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void SaveSectorFilter(SaveSectorFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void SaveIndustryFilter(SaveIndustryFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void SaveCompanyFilter(SaveCompanyFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void SaveQuoteFilter(SaveQuoteFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void SavePairFilter(SavePairFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void SaveXchangeRateFilter(SaveXchangeRateFilterRequest request);

        #endregion

        #region get methods

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetFavoriteNewsResponse GetFavoriteNews(GetFavoriteItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetFavoriteFeedResponse GetFavoriteFeed(GetFavoriteItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetFavoriteLinkResponse GetFavoriteLink(GetFavoriteItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetFavoriteNewsCollectionResponse GetFavoriteNewsCollection();

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetFavoriteFeedCollectionResponse GetFavoriteFeedCollection();

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetFavoriteLinkCollectionResponse GetFavoriteLinkCollection();

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetNewsFilterResponse GetNewsFilter(GetFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetSectorFilterResponse GetSectorFilter(GetFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetIndustryFilterResponse GetIndustryFilter(GetFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetCompanyFilterResponse GetCompanyFilter(GetFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetQuoteFilterResponse GetQuoteFilter(GetFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetPairFilterResponse GetPairFilter(GetFilterRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetXchangeRateFilterResponse GetXchangeRateFilter(GetFilterRequest request);
        
        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetNewsFiltersResponse GetNewsFilters();

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetSectorFiltersResponse GetSectorFilters();

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetIndustryFiltersResponse GetIndustryFilters();

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetCompanyFiltersResponse GetCompanyFilters();

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetQuoteFiltersResponse GetQuoteFilters();

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetPairFiltersResponse GetPairFilters();

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        GetXchangeRateFiltersResponse GetXchangeRateFilters();

        #endregion

        #region remove methods

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemoveFavoriteNews(RemoveItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemoveFavoriteFeed(RemoveItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemoveFavoriteLink(RemoveItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemoveNewsFilter(RemoveItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemoveSectorFilter(RemoveItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemoveIndustryFilter(RemoveItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemoveCompanyFilter(RemoveItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemoveQuoteFilter(RemoveItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemovePairFilter(RemoveItemRequest request);

        [OperationContract]
        [FaultContract(typeof(GeneralFault))]
        [FaultContract(typeof(BusinessFault))]
        [EISHeader(ServiceConstants.Headername, typeof(EISSession), Direction = SoapHeaderDirection.In)]
        [EISAutorize(Permissions = new[] { RoleType.User, RoleType.Admin })]
        void RemoveXchangeRateFilter(RemoveItemRequest request);

        #endregion
    }
}
